package com.ldf.tool.controller;

import com.ldf.tool.service.ITestTaskService;
import org.camunda.bpm.engine.repository.ProcessDefinition;
    import org.camunda.bpm.engine.task.Task;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author DunFan.Liao
 * @date 2024/3/12 16:48
 */
@RestController
@RequestMapping("/task")
public class TaskController {

    @Resource(name = ITestTaskService.BEAN_ID)
    private ITestTaskService testTaskService;

    @PostMapping("/startProcess")
    public void startProcess() {
        testTaskService.startProcess();
    }

    @GetMapping("/findProcesses")
    public List<ProcessDefinition> findProcesses() {
        return testTaskService.findProcesses();
    }
    @GetMapping("/findTasks")
    public List<Task> findTasks() {
        return testTaskService.findTasks();
    }
}
